package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.pojo.entity.QuestionBank;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface QuestionBankMapper extends BaseMapper<QuestionBank> {
    //查找
    @Select("select COUNT(*) from test.question_bank")
    int getQuestionBankSize();
    @Select("select * from test.question_bank")
    List<QuestionBank>initQuestionBank();
    //根据题型id统计数目
    @Select("select COUNT(*) from test.question_bank where category=#{categoryId}")
    int getCountByCategoryId(int categoryId);
    @Select("select * from test.question_bank where id=#{bankId}")
    List<QuestionBank>searchBankById(int bankId);
}
